package com.ppt.android.activity

import android.view.View
import androidx.activity.viewModels
import androidx.lifecycle.rxLifeScope
import com.ppt.android.activity.vm.AboutViewModel
import com.ppt.android.base.BaseActivity
import com.ppt.android.base.utils.BarUtils
import com.ppt.android.base.utils.IntentUtil
import com.ppt.android.databinding.ActivityAboutBinding
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
class AboutActivity :
    BaseActivity<ActivityAboutBinding, AboutViewModel>() {

    override fun ActivityAboutBinding.initView() {
        initStatusBarHeight(mBinding.statusView)

        mBinding.rlPrivacy.setOnClickListener {
            IntentUtil.gotoActivity(this@AboutActivity, WebViewActivity::class.java)
        }
        mBinding.ivBack.setOnClickListener{
            finish()
        }
    }


    override val mViewModel by viewModels<AboutViewModel>()

    override fun initObserve() {
    }

    override fun initRequestData() {


    }

    private fun initStatusBarHeight(view: View) {
        rxLifeScope.launch {
            val mLayoutParams = view.layoutParams
            val statusBarHeight = BarUtils.getStatusBarHeight()
            mLayoutParams.height = statusBarHeight
            view.layoutParams = mLayoutParams
        }
    }




}